package com.hutao.manage.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hutao.manage.service.BaseInfoService;
import com.hutao.manage.util.JsonUtil;



@Controller
@RequestMapping("/base_info")
public class BaseInfoController {

	@Autowired
	private BaseInfoService baseInfoService;
	
	@GetMapping("/ajax_diseases_by_query_name")
	@ResponseBody
	public String ajaxDiseaseByQueryName(String queryName){
		List<Map<String, Object>> diseases = baseInfoService.getDiseaseByQueryName(queryName);
		String jsonStr = JsonUtil.objectToJson(diseases);
		return jsonStr;
	}
	
	
	@GetMapping("/ajax_operate_by_query_name")
	@ResponseBody
	public String ajaxOperateByQueryName(String queryName){
		List<Map<String, Object>> operates = baseInfoService.getOperateByQueryName(queryName);
		String jsonStr = JsonUtil.objectToJson(operates);
		return jsonStr;
	}
	
	@GetMapping("/ajax_medical_worker_by_query_name")
	@ResponseBody
	public String ajaxMedicalWorkByQueryName(String queryName){
		List<Map<String, Object>> medicalWorks = baseInfoService.getMedicalWorkerByQueryName(queryName);
		String jsonStr = JsonUtil.objectToJson(medicalWorks);
		return jsonStr;
	}
	
	
	
	
	
	
	
}
